import { legacy_createStore as createStore } from "redux";

// 数据存储
import { persistStore, persistReducer } from "redux-persist";
import storage from "redux-persist/lib/storage"; // 本地存储
// import storage from "redux-persist/es/storage/session"; // 会话存储

import { reducer } from "../reducer";

const persistConfig = {
  key:'root',
  storage,
  // blacklisk:['count'] //  不进行存储的数据
}

const myPersistReducer = persistReducer(persistConfig,reducer)
const store = createStore(myPersistReducer)

const persistor = persistStore(store)

export {
  store,
  persistor
}

// export default createStore(reducer)


